function Album() {
	
	var _selectedPhotos = [] ;
	var _unselectedPhotos = [] ;
		
	//Bindings	
	this.addPhotoToAlbum = addPhotoToAlbum;
	this.addPhotoToUnselectedPhotos = addPhotoToUnselectedPhotos;
	this.getSelectedPhotos = getSelectedPhotos;
	this.getEventUnselectedPhotos = getEventUnselectedPhotos;
	this.getPhotoEntityByElementName = getPhotoEntityByElementName;
	this.getSelectedPhotosIds = getSelectedPhotosIds;
	
	

	function addPhotoToAlbum(aPhoto){				
		_selectedPhotos.push(aPhoto);	
		var idx = _unselectedPhotos.indexOf(aPhoto); // Find the index
		if(idx!=-1) _unselectedPhotos.splice(idx, 1);
	}
	
	function addPhotoToUnselectedPhotos(aPhoto){		
		_unselectedPhotos.push(aPhoto);
		var idx = _selectedPhotos.indexOf(aPhoto); // Find the index
		if(idx!=-1) _selectedPhotos.splice(idx, 1);		
	}
	
	function getSelectedPhotos(){
		return _selectedPhotos;
	}
	
	function getSelectedPhotosIds(){		
		var selectedPhotosIDs = [] ;
		for (i=0; i<_selectedPhotos.length; i++)
		{
		  var photo = _selectedPhotos[i];		  
		  selectedPhotosIDs.push(photo.getId());
		}		
		return selectedPhotosIDs;
	}
	
	function getEventUnselectedPhotos(){
		return _unselectedPhotos;
	}	
	
	function getPhotoEntityByElementName(name){
		// Itero las seleccionadas
		for (i=0; i<_selectedPhotos.length; i++)
		{
		  var photo = _selectedPhotos[i];
		  if (photo.getElementName()==name){
			  return photo;
		  }
		}
		// Itero las no seleccionadas
		for (i=0; i<_unselectedPhotos.length; i++)
		{
		  var photo = _unselectedPhotos[i];
		  if (photo.getElementName()==name){
			  return photo;
		  }
		}
		return undefined;
	}
}